﻿@using BonjourQuotation.UI.Models.CustomerModel
@model ManageCustomerInvoicesGridViewModel
<div style="width: 941px; min-height: 230px; max-height: 430px; margin: auto; padding-bottom: 30px; margin-left: 9px; ">
    <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 920px;background-color:white;">
        <thead>
            <tr>
                <th width="14%;" class="GridHeaders font12">Group Code</th>
                <th width="20%;" class="GridHeaders font12">Group Name</th>
                <th width="10%;" class="GridHeaders font12">Final</th>
                <th width="10%;" class="GridHeaders font12">Charged</th>
                <th width="10%;" class="GridHeaders font12">Payed</th>
                <th width="7%;" class="GridHeaders font12">Days</th>
                <th width="10%;" class="GridHeaders font12">Balance</th>
                <th width="10%;" class="GridHeaders font12">Is Gir</th>
                <th width="9%;" class="GridHeaders font12"></th>
            </tr>
        </thead>
    </table>
    <div style="height:370px; overflow-y:auto;">
        <table class="table table-bordered table-hover table-condensed" style="width: 920px; table-layout: fixed; background-color: white;">
            <tbody>
                @for (int ind = 0; ind < Model.Rows.Count; ind++)
                {
                    @Html.HiddenFor(model => model.Rows[ind].IsPushed)
                    <tr>
                        <td width="14%;">@Html.LabelForModel(Model.Rows[ind].GroupCode, new { @class = "table_inputs_125 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="20%;">@Html.LabelForModel(Model.Rows[ind].GroupName, new { @class = "table_inputs_180 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="10%;">@Html.LabelForModel(Model.Rows[ind].FinalPayment, new { @class = "table_inputs_90 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="10%;">@Html.LabelForModel(Model.Rows[ind].Charged, new { @class = "table_inputs_90 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="10%;">@Html.LabelForModel(Model.Rows[ind].Payed, new { @class = "table_inputs_90 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="7%;">@Html.LabelForModel(Model.Rows[ind].Days, new { @class = "table_inputs_60 FSizeForGroupTable", @style = "text-align: left" })</td>
                        <td width="10%;">
                            @if (Convert.ToDouble(Model.Rows[ind].Balance) < 0)
                            {
                                @Html.LabelForModel(Model.Rows[ind].Balance, new { @class = "table_inputs_90 FSizeForRedInvoicesTable", @style = "text-align: left" })
                            }
                            else
                            {
                                @Html.LabelForModel(Model.Rows[ind].Balance, new { @class = "table_inputs_90 FSizeForGreenInvoicesTable", @style = "text-align: left" })
                            }
                        </td>
                        <td width="10%;" style="overflow: hidden">@Html.LabelForModel(Model.Rows[ind].IsGir ? "Yes" : "No", new { @class = "table_inputs_85", @style = "text-align: left" })</td>
                        <td width="9%;" style="text-align:center"><button class="btn14 btn50 btnheight22" onclick="ShowOperationInvoice('@Model.Rows[ind].GroupCode','@Model.Rows[ind].IsPushed')">-></button></td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
<div style="width: 401px; float: left; margin-left: 10px">
    <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 400px;background-color:white;">
        <thead>
            <tr>
                <th width="20%;" class="GridHeaders">0-30</th>
                <th width="20%;" class="GridHeaders">30-60</th>
                <th width="20%;" class="GridHeaders">60-90</th>
                <th width="20%;" class="GridHeaders">90-120</th>
                <th width="20%;" class="GridHeaders">120-</th>
            </tr>
        </thead>
    </table>
    <div>
        <table class="table table-bordered table-hover table-condensed" style="width: 400px; table-layout: fixed; background-color: white;">
            <tbody>
                <tr>
                    <td style=" width: 20%; ">
                        @if (Convert.ToDouble(Model.BalanceSum_0_30_) < 0)
                        {
                            @Html.LabelForModel(Model.BalanceSum_0_30_, new { @class = "table_inputs_85 FSizeForRedInvoicesTable" })
                        }
                        else
                        {
                            @Html.LabelForModel(Model.BalanceSum_0_30_, new { @class = "table_inputs_85 FSizeForGreenInvoicesTable" })
                        }
                    </td>
                    <td style=" width: 20%; ">
                        @if (Convert.ToDouble(Model.BalanceSum_30_60_) < 0)
                        {
                            @Html.LabelForModel(Model.BalanceSum_30_60_, new { @class = "table_inputs_85 FSizeForRedInvoicesTable" })
                        }
                        else
                        {
                            @Html.LabelForModel(Model.BalanceSum_30_60_, new { @class = "table_inputs_85 FSizeForGreenInvoicesTable" })
                        }
                    </td>
                    <td style=" width: 20%; ">
                        @if (Convert.ToDouble(Model.BalanceSum_60_90_) < 0)
                        {
                            @Html.LabelForModel(Model.BalanceSum_60_90_, new { @class = "table_inputs_85 FSizeForRedInvoicesTable" })
                        }
                        else
                        {
                            @Html.LabelForModel(Model.BalanceSum_60_90_, new { @class = "table_inputs_85 FSizeForGreenInvoicesTable" })
                        }
                    </td>
                    <td style=" width: 20%; ">
                        @if (Convert.ToDouble(Model.BalanceSum_90_120_) < 0)
                        {
                            @Html.LabelForModel(Model.BalanceSum_90_120_, new { @class = "table_inputs_85 FSizeForRedInvoicesTable" })
                        }
                        else
                        {
                            @Html.LabelForModel(Model.BalanceSum_90_120_, new { @class = "table_inputs_85 FSizeForGreenInvoicesTable" })
                        }
                    </td>
                    <td style=" width: 20%; ">
                        @if (Convert.ToDouble(Model.BalanceSum_120_) < 0)
                        {
                            @Html.LabelForModel(Model.BalanceSum_120_, new { @class = "table_inputs_85 FSizeForRedInvoicesTable" })
                        }
                        else
                        {
                            @Html.LabelForModel(Model.BalanceSum_120_, new { @class = "table_inputs_85 FSizeForGreenInvoicesTable" })
                        }
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    
</div>
<div class=" col-lg-2" style="float: right; margin-top: 26px">
    <div class="input-group">
        <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.BalanceSumTotal)</span>
        @if (Convert.ToDouble(Model.BalanceSumTotal) < 0)
        {
            @Html.LabelForModel(Model.BalanceSumTotal, new { @class = "table_inputs_SmallPadding2 form-control FSizeForRedInvoicesTable" })
        }
        else
        {
            @Html.LabelForModel(Model.BalanceSumTotal, new { @class = "table_inputs_SmallPadding2 form-control FSizeForGreenInvoicesTable" })
        }
    </div>
</div>